package top.tresman.cxxcommon.entity.sms;

import lombok.Getter;

@Getter
public enum SceneEnum {
    LOGIN(1, "登录", "login"),
    FORGET(2, "找回密码", "forget"),
    ;
    private final Integer value;
    private final String label;
    private final String code;

    SceneEnum(Integer value, String label, String code) {
        this.value = value;
        this.label = label;
        this.code = code;
    }

    public static SceneEnum getByValue(Integer value) {
        if (null == value) {
            return null;
        }

        for (SceneEnum sceneEnum : SceneEnum.values()) {
            if (sceneEnum.getValue().equals(value)) {
                return sceneEnum;
            }
        }

        return null;
    }
}
